home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 11 / CU Amiga Magazine's Super CD-ROM 11 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-06].iso / cucd / graphics / mpimage / docs / mpimage.doc
Text File  |  1997-03-14  |  25KB  |  863 lines

  1.  
  2.  
  3. TABLE OF CONTENTS
  4.  
  5. MPImage.library/--background--
  6. MPImage.library/FreeMPImage
  7. MPImage.library/LoadMPImage
  8. MPImage.library/MPChunkyToPlanar
  9. MPImage.library/MPGreyToPal
  10. MPImage.library/MPImageErrorMessage
  11. MPImage.library/MPPalToGrey
  12. MPImage.library/MPPalToPal
  13. MPImage.library/MPPalToRGB
  14. MPImage.library/MPPlanarToChunky
  15. MPImage.library/MPProgressHook
  16. MPImage.library/MPRGBToGrey
  17. MPImage.library/MPRGBToPal
  18. MPImage.library/MPScaleGrey
  19. MPImage.library/MPScaleRGB
  20. MPImage.library/RescaleMPImage
  21. MPImage.library/SaveMPImageA
  22. MPImage.library/SetMPImageScreen
  23.  
  24.  
  25. MPImage.library/--background--                  MPImage.library/--background--
  26.  
  27.  Version 7.3 - fixed enforcer hit when no progress requester.
  28.              - Opens locale.library(38) to work on OS3.0.
  29.  
  30.  MPImage.library lets you load save and process images.
  31.  
  32.  Stuctures/Formats:
  33.  
  34.   RGB Chunky    This is held as seperate Red Green and Blue
  35.                 UBYTE *, with a Width and Height
  36.   Grey Chunky   This is held as one Grey UBYTE * (often called
  37.                 red), with a Width and a Height.
  38.   Palette       This is held as one UBYTE[768] (sometimes called
  39.                 red, a Width and Height, and a UBYTE *Palette. The
  40.                 palette holds the red palette in [0] to [255],
  41.                 the green palette in [256] to [511] and the blue
  42.                 palette in [512] to [767]. There may also be a
  43.                 camg (or modeid) and a number of colours, or
  44.                 number of planes. These are required for EHB and
  45.                 HAM images.
  46.   Bitmap        A normal planar bit map. This also has other
  47.                 fields as for Palette.
  48.   EGSBitMap     A standard EGSBitMap.
  49.   MPImage       This holds one of RGB, Grey, Bitmap or EGSBitMap.
  50.   MPProcess     This holds the RGB pointers and width and height.
  51.                 It is used for some processing functions.
  52.  
  53.  Image Loading:
  54.  
  55.   LoadMPImage()   Loads an image from disc/clipboard.
  56.                   It loads various formats.
  57.                   Returns BitMap, RGB, GreyScale or EGSBitMap.
  58.  
  59.  Image Saving:
  60.  
  61.   SaveMPImage()   Can save RGB/GreyScale to disc.
  62.                   It saves in various formats.
  63.  
  64.  ImageScaling:
  65.  
  66.   RescaleMPImage() Scales a loaded image (any format).
  67.  
  68.  Displaying Images
  69.  
  70.   SaveMPImage()    Can display RGB/GreyScale Buffers.
  71.  
  72.  Miscellaneous:
  73.  
  74.   FreeMPImage()         Frees a loaded image.
  75.   SetMPImageScreen()    Sets the screen for the progress requester.
  76.   MPProgressHook()      Sets a progress hook for messages.
  77.   MPImageErrorMessage() Returns the last error message.
  78.  
  79.  Planar/Chunky Conversion:
  80.  
  81.   MPPlanarToChunky() Converts a BitMap to a chunky buffer.
  82.   MPChunkyToPlanar() Converts a chunky buffer to a BitMap.
  83.   SaveMPImage()      Can convert RGB Buffers to a BitMap.
  84.  
  85.  Image processing:
  86.  
  87.   Image processing is done on chunky buffers; RGB, GreyScale
  88.   or Palette based. The following convert between these formats.
  89.  
  90.   MPGreyToPal()  GreyScale to Palette.
  91.   MPPalToGrey()  Palette to GreyScale.
  92.   MPPalToPal()   Palette to a different Palette.
  93.   MPPalToRGB()   Palette to RGB.
  94.   MPRGBToGrey()  RGB To Grey.
  95.   MPRGBToPal()   RGB To Palette.
  96.  
  97.   Buffers can also be scaled:
  98.  
  99.   MPScaleGrey()  Scales one buffer.
  100.   MPScaleRGB()   Scales 3 buffers.
  101.                  Same as 3 calls to MPScaleGrey() but faster.
  102.  
  103.  Summary:
  104.  
  105.  Input                            Output Format
  106.  Format   !Disc! RGB !Gray !Palette!BitMap!EGSBitMap!MPImage!Screen
  107.  ---------!----!-----!-----!-------!------!---------!-------!------
  108.  Disc/Clip!    !1*   !1*   !       !1*    !1*       !1      !
  109.  RGB      !2   !13,3*!10   !11     !2     !         !       !2
  110.  Gray     !2   !x    !12,3*!6      !2     !         !       !2
  111.  Palette  !    !9    !7    !8      !5     !         !       !
  112.  BitMap   !    !     !     !4      !3*,o  !         !       !
  113.  EGSBitMap!    !     !     !       !      !3*       !       !
  114.  MPImage  !2+  !+    !+    !#      !+     !+        !3      !2+
  115.  
  116.   1 - LoadMPImage()
  117.   2 - SaveMPImage()
  118.   3 - RescaleMPImage()
  119.   4 - MPPlanarToChunky()
  120.   5 - MPChunkyToPlanar()
  121.   6 - MPGreyToPal()
  122.   7 - MPPalToGrey()
  123.   8 - MPPalToPal()
  124.   9 - MPPalToRGB()
  125.  10 - MPRGBToGrey()
  126.  11 - MPRGBToPal()
  127.  12 - MPScaleGrey()
  128.  13 - MPScaleRGB()
  129.   * - As part of an MPImage
  130.   + - Depends on parameters to LoadMPImage
  131.   x - Easy - no function supplied
  132.   o - See BitMapScale()
  133.   # - Depends on LoadMPImage, use 11,6,8 or 4
  134.  
  135. MPImage.library/FreeMPImage                        MPImage.library/FreeMPImage
  136.  
  137.    NAME   
  138.   FreeMPImage -- Free an image loaded using LoadMPImage() (V3)
  139.  
  140.    SYNOPSIS
  141.   FreeMPImage( MPi )
  142.                A0
  143.  
  144.   void FreeMPImage( struct MPImage * );
  145.  
  146.    FUNCTION
  147.   Frees all data associated loaded with an image using LoadMPImage().
  148.  
  149.    INPUTS
  150.   MPi - structure returned by LoadMPImage().
  151.  
  152.    RESULT
  153.   None.
  154.  
  155.    EXAMPLE
  156.  
  157.    NOTES
  158.  
  159.    BUGS
  160.  
  161.    SEE ALSO
  162.   LoadMPImage()
  163.  
  164. MPImage.library/LoadMPImage                        MPImage.library/LoadMPImage
  165.  
  166.    NAME   
  167.   LoadMPImage -- Load an image in various formats (V4)
  168.  
  169.    SYNOPSIS
  170.   MPi = LoadMPImage( filename,screen,Flags )
  171.   D0                       A0       A1     D0
  172.  
  173.   struct MPImage *LoadMPImage
  174.                   ( const char *,struct Screen *,ULONG);
  175.  
  176.    FUNCTION
  177.   Load an image in BitMap, EGSBitMap or RGB format.
  178.  
  179.    INPUTS
  180.   filename - name of file from which to load image
  181.            - -c or -cnumber for clipboard
  182.   screen   - screen on which BitMap is to be used. May be NULL.
  183.   Flags    - Flags to control image loading
  184.       Default is to remap to screen palette and return a bitmap in BitMap
  185.       Only way to free is to call FreeMPImage().
  186.  
  187.       MPIF_EGS         - Return E_EBitMap rather than BitMap. 
  188.           Overrides MPIF_RGB
  189.       MPIF_CLONEBITMAP - You are free to zero BitMap/EGS_BitMap before
  190.           calling FreeMPImage(). You must then call FreeBitMap() or 
  191.           E_DisposeBitMap() yourself. Ignored for MPIF_RGB/GREY. If screen
  192.           supplied then clone is screen depth deep if possible.
  193.       MPIF_NOREMAP     - Don't remap to the current screen colors. Ignored
  194.           for MPIF_EGS/RGB/GREY. Returns error if 24 bit input.
  195.       MPIF_RGB         - return Red, Green, Blue instead of BitMap.
  196.       MPIF_GREY        - return Red, Green, Blue instead of BitMap. If
  197.           image is greyscale then Red, Green and Blue will be the same
  198.           and GreyScale will be TRUE
  199.       MPIF_FORCEGREY   - As MPIF_GREY except input will always be remapped
  200.           to greyscale.
  201.       MPIF_LINEARGREY  - Use linear (not colour based) mapping (V5.0)
  202.  
  203.    RESULT
  204.   MPi - Pointer to an MPImage structure holding the image data.
  205.         NULL if an error occurs. Use MPImageErrorMessage() to get error.
  206.  
  207.    EXAMPLE
  208.  
  209.    NOTES
  210.   If file format is JPG and env/mpimage/djpeg is set (e.g. djpeg "%s" "%s")
  211.   and not loading a BitMap then djpeg is used.
  212.  
  213.   If file format is PNG and env/mpimage/pngtopnm is set
  214.   (e.g. pngtopnm "%s" >"%s") and not loading a BitMap then pngtopnm is used.
  215.  
  216.   Other fileformats are IBLM (depth 1 to 8 and 24, EHB, HAM6 and HAM8),
  217.   PBM (all types) and any picture datatype. With dctv.library(3) can also
  218.   load DCTV images.
  219.  
  220.    BUGS
  221.   Waits 20 seconds for djpeg/pngtopnm to start then aborts.
  222.   Fails to set an error message if failure loading from clipboard.
  223.   Can also fail to set an error message in other (unknown) circumstances.
  224.  
  225.    SEE ALSO
  226.   FreeMPImage(),MPImageErrorMessage,graphics.library/FreeBitMap(),
  227.   egs.library/E_DisposeBitMap(),MPImageErrorMessage().
  228.  
  229. MPImage.library/MPChunkyToPlanar              MPImage.library/MPChunkyToPlanar
  230.  
  231.    NAME   
  232.   MPChunkyToPlanar -- Convert a chunky buffer to a BitMap (V7)
  233.  
  234.    SYNOPSIS
  235.   MPChunkyToPlanar( chunky, bitmap, width, height )
  236.                     A0      A1      D0     D1
  237.  
  238.   void MPPlanarToChunky( UBYTE *, struct BitMap *, UWORD, UWORD);
  239.  
  240.    FUNCTION
  241.   Converts a chunky buffer to a BitMap.
  242.  
  243.    INPUTS
  244.   chunky - Pointer to a chunky buffer of sufficient size.
  245.   bitmap - Pointer to a standard bitmap (of sufficient size).
  246.   width  - Width of buffer.
  247.   height - Height of buffer.
  248.  
  249.    RESULT
  250.   None.
  251.  
  252.    EXAMPLE
  253.  
  254.    NOTES
  255.  
  256.    BUGS
  257.  
  258.    SEE ALSO
  259.   MPPlanarToChunky().
  260.  
  261. MPImage.library/MPGreyToPal                        MPImage.library/MPGreyToPal
  262.  
  263.    NAME   
  264.   MPGreyToPal -- Convert GreyScale image to a palette (V7)
  265.  
  266.    SYNOPSIS
  267.   MPGreyToPal( MPp,maxcol,pal )
  268.                A0  D0     A1
  269.  
  270.   void MPGreyToPal
  271.                 ( struct MPProcess *,ULONG,UBYTE *,BOOL);
  272.  
  273.    FUNCTION
  274.   Convert Grey to a palette.
  275.  
  276.    INPUTS
  277.   MPp      - Contains (in Read) the GreyScale chunky pixels
  278.              and the Width and Height
  279.   maxcol   - The number of colours in the palette.
  280.   pal      - The palette. This is a 768 byte array.
  281.              r[0] to r[maxcol] hold the Red palette
  282.              r[256] to r[256+maxcol] hold the Green palette
  283.              r[512] to r[512+maxcol] hold the Blue palette
  284.  
  285.    RESULT
  286.   The data pointed to by MPp->Red is updated to the palette mapped image.
  287.  
  288.    EXAMPLE
  289.  
  290.    NOTES
  291.  
  292.    BUGS
  293.   Not tested.
  294.  
  295.    SEE ALSO
  296.   MPRGBToPal().
  297.  
  298. MPImage.library/MPImageErrorMessage        MPImage.library/MPImageErrorMessage
  299.  
  300.    NAME   
  301.   MPImageErrorMessage -- Return the last error set by MPImage.library. (V3)
  302.  
  303.    SYNOPSIS
  304.   msg = MPImageErrorMessage()
  305.   D0
  306.  
  307.   char *MPImageErrorMessage( void );
  308.  
  309.    FUNCTION
  310.   Returns the last error message set by this opener of MPImage.library.
  311.  
  312.    INPUTS
  313.   None.
  314.  
  315.    RESULT
  316.   Formatted Error Message.
  317.  
  318.    EXAMPLE
  319.  
  320.    NOTES
  321.  
  322.    BUGS
  323.  
  324.    SEE ALSO
  325.  
  326. MPImage.library/MPPalToGrey                        MPImage.library/MPPalToGrey
  327.  
  328.    NAME   
  329.   MPPalToGrey -- Convert palette image to GreyScale (V7)
  330.  
  331.    SYNOPSIS
  332.   MPPalToGrey(Width,Height,pal,chunky,nPlanes,camg,Linear);
  333.               D0    D1     A0  A1      D2     D3   D4
  334.  
  335.   void MPPalToGrey
  336.              (UWORD,UWORD,UBYTE *,UBYTE *,UWORD,ULONG,BOOL);
  337.  
  338.    FUNCTION
  339.   Convert palette image to GreyScale.
  340.  
  341.    INPUTS
  342.   Width    - Width of image.
  343.   Height   - Height of image.
  344.   pal      - The current palette. This is a 768 byte array.
  345.              [0] to [...] hold the Red palette
  346.              [256] to [256+...] hold the Green palette
  347.              [512] to [512+...] hold the Blue palette
  348.   chunky   - The current chunky pixels.
  349.   nPlanes  - The number of planes in the current palette.
  350.   camg     - The camg of the current palette.
  351.   Linear   - If True then map linear,
  352.              otherwise give more weight to Green.
  353.  
  354.    RESULT
  355.   The data pointed to by chunky is updated to the GreyScale pixels.
  356.  
  357.    EXAMPLE
  358.  
  359.    NOTES
  360.   nPlanes and camg are required to cater for EHB and HAM.
  361.  
  362.    BUGS
  363.   Not tested.
  364.  
  365.    SEE ALSO
  366.   MPPalToRGB().
  367.  
  368. MPImage.library/MPPalToPal                          MPImage.library/MPPalToPal
  369.  
  370.    NAME   
  371.   MPPalToPal -- Convert image with one palette to another palette (V7)
  372.  
  373.    SYNOPSIS
  374.   MPPalToPal(OldPal,OldCols,NewPal,NewCols,chunky,Width,Height,
  375.              nPlanes,camg);
  376.              A0     D0      A1     D1      A2     D2    D3
  377.              D4      D5
  378.  
  379.   void MPPalToPal
  380.              ( UBYTE *,ULONG,UBYTE *,ULONG,UBYTE *,UWORD,UWORD,
  381.                UWORD, ULONG);
  382.  
  383.    FUNCTION
  384.   Convert image with one palette to another palette.
  385.  
  386.    INPUTS
  387.   OldPal   - The current palette. This is a 768 byte array.
  388.              [0] to [maxcol] hold the Red palette
  389.              [256] to [256+maxcol] hold the Green palette
  390.              [512] to [512+maxcol] hold the Blue palette
  391.   OldCols  - The number of colours in the current palette.
  392.   NewPal   - The new palette. This is a 768 byte array.
  393.              [0] to [maxcol] hold the Red palette
  394.              [256] to [256+maxcol] hold the Green palette
  395.              [512] to [512+maxcol] hold the Blue palette
  396.   NewCols  - The number of colours in the new palette.
  397.   chunky   - The chunky pixels.
  398.   Width    - The width of the image.
  399.   Height   - The height of the image.
  400.   nPlanes  - The number of planes in the current palette
  401.   camg     - The camg of the current palette
  402.  
  403.    RESULT
  404.   The data pointed to by chunky is updated to the new palette.
  405.  
  406.    EXAMPLE
  407.  
  408.    NOTES
  409.   nPlanes and camg are required to cater for EHB and HAM.
  410.  
  411.    BUGS
  412.   Not tested.
  413.  
  414.    SEE ALSO
  415.  
  416. MPImage.library/MPPalToRGB                          MPImage.library/MPPalToRGB
  417.  
  418.    NAME   
  419.   MPPalToRGB -- Convert palette image to RGB (V7)
  420.  
  421.    SYNOPSIS
  422.   MPPalToRGB(MPp,pal,chunky,nPlanes,camg);
  423.              A0  A1  A2     D0      D1
  424.  
  425.   void MPPalToRGB
  426.              ( struct MPProcess *,UBYTE *,UBYTE *,UWORD,ULONG);
  427.  
  428.    FUNCTION
  429.   Convert palette image to RGB.
  430.  
  431.    INPUTS
  432.   MPp      - Holds buffers to store the Red, Green and Blue pixels
  433.              and the Width and the Height.
  434.   pal      - The current palette. This is a 768 byte array.
  435.              [0] to [...] hold the Red palette
  436.              [256] to [256+...] hold the Green palette
  437.              [512] to [512+...] hold the Blue palette
  438.   chunky   - The current chunky pixels.
  439.   nPlanes  - The number of planes in the current palette
  440.   camg     - The camg of the current palette
  441.  
  442.    RESULT
  443.   The data pointed to by MPp->Red, MPp->Green and MPp->Blue are updated
  444.   to the RGB pixels.
  445.  
  446.    EXAMPLE
  447.  
  448.    NOTES
  449.   nPlanes and camg are required to cater for EHB and HAM.
  450.  
  451.    BUGS
  452.   Not tested.
  453.  
  454.    SEE ALSO
  455.   MPPalToGrey().
  456.  
  457. MPImage.library/MPPlanarToChunky              MPImage.library/MPPlanarToChunky
  458.  
  459.    NAME   
  460.   MPPlanarToChunky -- Convert a bitmap to a chunky buffer (V5)
  461.  
  462.    SYNOPSIS
  463.   MPPlanarToChunky( bitmap, chunky, width, height )
  464.                     A0      A1      D0     D1
  465.  
  466.   void MPPlanarToChunky( struct BitMap *, UBYTE *, UWORD, UWORD);
  467.  
  468.    FUNCTION
  469.   Converts a BitMap to a chunky buffer.
  470.  
  471.    INPUTS
  472.   bitmap - Pointer to a standard bitmap.
  473.   chunky - Pointer to a chunky buffer of sufficient size.
  474.   width  - Width of bitmap.
  475.   height - Height of bitmap.
  476.  
  477.    RESULT
  478.   None.
  479.  
  480.    EXAMPLE
  481.  
  482.    NOTES
  483.  
  484.    BUGS
  485.  
  486.    SEE ALSO
  487.   MPChunkyToPlanar().
  488.  
  489. MPImage.library/MPProgressHook                  MPImage.library/MPProgressHook
  490.  
  491.    NAME   
  492.   MPProgressHook -- Sets the Progress Hook (V6)
  493.  
  494.    SYNOPSIS
  495.   MPProgressHook(Hook)
  496.                  A0
  497.  
  498.   void MPProgressHook(struct Hook*);
  499.  
  500.    FUNCTION
  501.   Sets the Hook to call for progress messages.
  502.  
  503.    INPUTS
  504.   Hook - Hook to call
  505.  
  506.    RESULT
  507.   None.
  508.  
  509.    EXAMPLE
  510.  
  511.    NOTES
  512.   Called with...
  513.  object = MPIP_MAX, (ULONG)message = max-progress
  514.  object = MPIP_MAX, (ULONG)message = curr-progress
  515.  object = MPIP_CURR,(UBYTE *)message = Progress-Message
  516.  
  517.    BUGS
  518.  
  519.    SEE ALSO
  520.  
  521. MPImage.library/MPRGBToGrey                        MPImage.library/MPRGBToGrey
  522.  
  523.    NAME   
  524.   MPRGBToGrey -- Convert RGB image to GreyScale (V7)
  525.  
  526.    SYNOPSIS
  527.   MPRGBToGrey(MPp,Linear);
  528.               A0  D0
  529.  
  530.   void MPRGBToGrey
  531.              (struct MPProcess *,BOOL);
  532.  
  533.    FUNCTION
  534.   Convert RGB image to GreyScale.
  535.  
  536.    INPUTS
  537.   MPp      - Contains the Red,Green and Blue chunky pixels
  538.              and the Width and Height
  539.   Linear   - If True then map linear,
  540.              otherwise give more weight to Green.
  541.  
  542.    RESULT
  543.   The data pointed to by MPp->Red is updated to the GreyScale pixels.
  544.  
  545.    EXAMPLE
  546.  
  547.    NOTES
  548.  
  549.    BUGS
  550.   Not tested.
  551.  
  552.    SEE ALSO
  553.  
  554. MPImage.library/MPRGBToPal                          MPImage.library/MPRGBToPal
  555.  
  556.    NAME   
  557.   MPRGBToPal -- Convert RGB image to a palette (V7)
  558.  
  559.    SYNOPSIS
  560.   MPRGBToPal( MPp,maxcol,pal,bit12 )
  561.               A0  D0     A1  D1
  562.  
  563.   void MPRGBToPal
  564.                 ( struct MPProcess *,ULONG,UBYTE *,BOOL);
  565.  
  566.    FUNCTION
  567.   Convert RGB to a palette.
  568.  
  569.    INPUTS
  570.   MPp      - Contains the Red,Green and Blue chunky pixels
  571.              and the Width and Height
  572.   maxcol   - The number of colours in the palette.
  573.   pal      - The palette. This is a 768 byte array.
  574.              pal[0] to pal[maxcol] hold the Red palette
  575.              pal[256] to pal[256+maxcol] hold the Green palette
  576.              pal[512] to pal[512+maxcol] hold the Blue palette
  577.   bit12    - If set then only the top 4 bits of the palette
  578.              are used and the mapping is far quicker.
  579.  
  580.    RESULT
  581.   The data pointed to by MPp->Red is updated to the palette mapped image.
  582.  
  583.    EXAMPLE
  584.  
  585.    NOTES
  586.   If there is insufficient memory then bit12 is treated as false.
  587.  
  588.    BUGS
  589.   Not tested.
  590.  
  591.    SEE ALSO
  592.   MPGreyToPal().
  593.  
  594. MPImage.library/MPScaleGrey                        MPImage.library/MPScaleGrey
  595.  
  596.    NAME   
  597.   MPScaleGrey -- Scales a GreyScale image (V7)
  598.  
  599.    SYNOPSIS
  600.   MPScaleGrey( Old,New,OWidth,OHeight,NWidth,NHeight,Temp)
  601.                A0  A1  D0     D1      D2     D3      A2
  602.  
  603.   void MPScaleGrey
  604.            ( UBYTE *,UBYTE *,UWORD,UWORD,UWORD,UWORD,UBYTE *);
  605.  
  606.    FUNCTION
  607.   Scales an RGB image.
  608.  
  609.    INPUTS
  610.   Old      - Contains existing chunky pixels.
  611.   New      - Buffer for the new chunky pixels.
  612.   OWidth   - Current Width.
  613.   OHeight  - Current Height.
  614.   NWidth   - New Width.
  615.   NHeight  - New Height.
  616.   Temp     - Temporary buffer sized for the new image.
  617.  
  618.    RESULT
  619.   The data pointed to by New is updated to the scaled image.
  620.  
  621.    EXAMPLE
  622.  
  623.    NOTES
  624.  
  625.    BUGS
  626.   Not tested.
  627.  
  628.    SEE ALSO
  629.   MPScaleRGB().
  630.  
  631. MPImage.library/MPScaleRGB                          MPImage.library/MPScaleRGB
  632.  
  633.    NAME   
  634.   MPScaleRGB -- Scales an RGB image (V7)
  635.  
  636.    SYNOPSIS
  637.   MPScaleRGB( Old,New,Temp)
  638.               A0  A1  A2
  639.  
  640.   void MPScaleRGB
  641.            ( struct MPProcess *,struct MPProcess *,struct MPProcess *);
  642.  
  643.    FUNCTION
  644.   Scales an RGB image.
  645.  
  646.    INPUTS
  647.   Old      - Contains the Red,Green and Blue chunky pixels
  648.              and the Width and Height of the current image.
  649.   New      - Contains the Red,Green and Blue chunky pixels
  650.              and the Width and Height for the new image.
  651.   Temp     - Contains 3 temporary buffers sized for the new image.
  652.  
  653.    RESULT
  654.   The data pointed to by New->Red/Green/Blue is updated to 
  655.   the scaled image.
  656.  
  657.    EXAMPLE
  658.  
  659.    NOTES
  660.  
  661.    BUGS
  662.   Not tested.
  663.  
  664.    SEE ALSO
  665.   MPScaleGrey().
  666.  
  667. MPImage.library/RescaleMPImage                  MPImage.library/RescaleMPImage
  668.  
  669.    NAME   
  670.   RescaleMPImage -- Scales an image created by LoadMPImage() (V3)
  671.  
  672.    SYNOPSIS
  673.   error = RescaleMPImage(MPi, x, y)
  674.   D0                     A0   D0 D1
  675.  
  676.   BOOL RescaleMPImage(struct MPImage *, UWORD, UWORD);
  677.  
  678.    FUNCTION
  679.   Scales an Image loaded by LoadMPImage() to new width and height.
  680.  
  681.    INPUTS
  682.   MPi - Image loaded by LoadMPImage
  683.   x   - New width of image
  684.   y   - New height of image
  685.  
  686.    RESULT
  687.   error - 1 for success, 0 for failure.
  688.           Use MPImageErrorMessage() to get error.
  689.  
  690.    EXAMPLE
  691.  
  692.    NOTES
  693.   Rescaling of bitmaps is done using BitMapScale().
  694.   Other rescaling is done using custom code with smoothing.
  695.  
  696.   If this function fails then the MPImage is no longer usable and
  697.   FreeMPImage() should be called to free it.
  698.  
  699.   Version 4.3 is faster for RGB.
  700.  
  701.    BUGS
  702.   Bitmaps may not scale smoothly.
  703.   The rescaling of EGS images is not efficent.
  704.  
  705.    SEE ALSO
  706.   LoadMPImage(),MPImageErrorMessage(),FreeMPImage(),
  707.   graphics.library/BitMapScale().
  708.  
  709. MPImage.library/SaveMPImageA                      MPImage.library/SaveMPImageA
  710.  
  711.    NAME   
  712.   SaveMPImageA -- Save an image in various formats. (V3)
  713.   SaveMPIMage -- Varargs version of SaveMPImageA (V3)
  714.  
  715.    SYNOPSIS
  716.   succ = SaveMPImageA( file,red,green,blue,width,height,taglist)
  717.   D0                   A0   A1  A2    A3   D0    D1     A5
  718.  
  719.   BOOL SaveMPImageA( UBYTE *,UBYTE *,UBYTE *,UBYTE *,
  720.                                    UWORD,UWORD,struct TagItem *);
  721.  
  722.   succ = SaveMPImage( file,red,green,blue,width,height,Tag1, ...)
  723.  
  724.   BOOL SaveMPImage( UBYTE *,UBYTE *,UBYTE *,UBYTE *,
  725.                                    UWORD,UWORD,ULONG,...);
  726.  
  727.    FUNCTION
  728.   Saves/displays an image held in chunky buffers.
  729.  
  730.    INPUTS
  731.   file    - filename to save file as. If NULL or "" then image is
  732.             displayed on a custom screen, or returned in BitMap (V7.0)
  733.   red     - red chunky input.
  734.   green   - green chunky input.
  735.   blue    - blue chunky input.
  736.   width   - width of chunky buffers
  737.   height  - height of chunky buffers.
  738.   taglist - pointer to TagItem array.
  739.  
  740.   Tags are:
  741.  
  742.   MPIS_MODE   - Data is ULONG CAMG of output IFF file/screen EHB and HAM
  743.                 will be added if required. If not supplied then
  744.                 MPIS_MODENAME will be used. If that is not supplied then
  745.                 a CAMG mode will be generated.
  746.   MPIS_MODENAME - Data is char * mode name of CAMG of output. Invalid
  747.                   names are ignored.
  748.   MPIS_FORMAT - Data is char * specifying output format.
  749.                 Default is MPI_BW16. Values are:
  750.                 MPI_BW16   - "BW16"   - 16 colour ILBM grey scale.
  751.                 MPI_BW256  - "BW256"  - 256 colour ILBM grey scale.
  752.                 MPI_HAM6   - "HAM6"   - HAM6 with fixed (internal) palette.
  753.                 MPI_HAM6P  - "HAM6P"  - HAM6 with generated or supplied
  754.                                         palette - see MPIS_PALETTE.
  755.                 MPI_HAM8   - "HAM8"   - HAM8 with fixed (internal) palette.
  756.                 MPI_HAM8P  - "HAM8P"  - HAM8 with generated or supplied
  757.                                         palette - see MPIS_PALETTE.
  758.                 MPI_ILBM24 - "ILBM24" - 24 bit ILBM.
  759.                 MPI_PPM    - "PPM"    - P6 (or P5 if red,green and blue are
  760.                                         the same).
  761.                 MPI_COLOUR - "COLOUR" - ILBM with generated or supplied
  762.                                         palette - see MPIS_PALETTE.
  763.                 MPI_EHB    - "EHB"    - EHB with generated or supplied
  764.                                         palette - see MPIS_PALETTE.
  765.                 MPI_JPEG   - "JPEG"   - JPEG see NOTES.
  766.                 MPI_PNM    - "PNG"    - PNG see NOTES.
  767.                 MPI_DCTV3  - "DCTV3"  - DCTV 3 bit plane format
  768.                 MPI_DCTV4  - "DCTV4"  - DCTV 4 bit plane format
  769.   MPIS_PALETTE - Data is char * name of ILBM to load palette from.
  770.   MPIS_COLOURS - Data is ULONG number of colours for MPI_COLOUR.
  771.                  Default is is number of colours in MPIS_PALETTE if
  772.                  supplied, otherwise 16. If greater than that from
  773.                  MPIS_PALETTE then ignored.
  774.   MPIS_12BIT   - Data is BOOL. If TRUE then use faster 12bit colour palette
  775.                  generating algorithm for MPI_COLOUR and MPI_EHB. Default
  776.                  is FALSE to use 18bit algorithm.
  777.   MPIS_LINEAR  - Data is BOOL. If TRUE then for BW16/BW256 use linear
  778.                  (not colour based) mapping. (V5.0)
  779.   MPIS_GREYMAP - Data is UBYTE *. For BW16/BW256 palette map. Must point
  780.                  to at least 16 of value 0 to 15 for BW16, 256 bytes of
  781.                  0 to 255 for BW255. (V5.0)
  782.                  Format is e.g. 0,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1
  783.                    Colour 0 will be black
  784.                    Colour 1 will be white
  785.                    etc.
  786.                  This is the opposite to which you may expect!
  787.   MPIS_OLDPALETTE - Palette to use (for HAMxP/COLOUR/EHB) (V7.0)
  788.                     Data is UBYTE *, red in [0] to [255],
  789.                                      green in [256] to [511]
  790.                                      blue in [512] to [767]
  791.   MPIS_NEWPALETTE - Palette used (for HAMx/COLOUR/EHB) (V7.0)
  792.                     Data is UBYTE * (see MPIS_OLDPALETTE).
  793.   MPIS_BITMAP  - BitMap to update (for BWxx/HAMxx/COLOUR/EHB/DCTVx) (V7.0)
  794.                  Data is struct BitMap *
  795.                  Image is not displayed/saved
  796.  
  797.    RESULT
  798.   error - 1 for success, 0 for failure.
  799.           Use MPImageErrorMessage() to get error.
  800.  
  801.    EXAMPLE
  802.  
  803.    NOTES
  804.   If MPIS_FORMAT is BW16 or BW256 and red,green and blue are the same then
  805.   a more efficent algorithm is used.
  806.  
  807.   When displaying on screen click in the top left and press a key to exit.
  808.  
  809.   If file format is JPEG and env/mpimage/cjpeg is set (e.g. cjpeg "%s" "%s")
  810.   then cjpeg is used.
  811.  
  812.   If file format is PNG and env/mpimage/pnmtopng is set
  813.   (e.g. 'pnmtopng "%s" >"%s"') then pnmtopng is used.
  814.  
  815.    BUGS
  816.   Does not work for images > 1024 wide (except PPM/JPEG/PNG).
  817.   The palette file requires a body which is loaded and then discarded.
  818.  
  819.   Waits 20 seconds for cjpeg/pnmtopng to start then aborts. This check is
  820.   not fool proof and the PIPE:xxx can be left hanging.
  821.  
  822.   Prior to version 4.3 fails to determine a screen mode correctly.
  823.  
  824.   V7.0 did not handle MPIS_BITMAP correctly.
  825.  
  826.   V7.3 did not set return code when MPIS_BITMAP supplied.
  827.  
  828.    SEE ALSO
  829.   MPImageErrorMessage().
  830.  
  831. MPImage.library/SetMPImageScreen              MPImage.library/SetMPImageScreen
  832.  
  833.    NAME   
  834.   SetMPImageScreen -- Sets the Screen name for progress requesters (V3)
  835.  
  836.    SYNOPSIS
  837.   SetMPImageScreen(ScreenName,Flags)
  838.                    A0         D0
  839.  
  840.   void SetMPImageScreen(char *, ULONG);
  841.  
  842.    FUNCTION
  843.   Sets the Screen Name for progress requesters for this opener.
  844.  
  845.    INPUTS
  846.   ScreenName - Name of Public Screen, NULL for default
  847.   Flags      - 0 - Do not show progress requesters (default)
  848.              - MPIF_PROGRESS - Do show progress requesters
  849.                                (except for non remapped bitmaps).
  850.  
  851.    RESULT
  852.   None.
  853.  
  854.    EXAMPLE
  855.  
  856.    NOTES
  857.   ScreenName must remain valid while MPImage.library is open.
  858.  
  859.    BUGS
  860.  
  861.    SEE ALSO
  862.  
  863.